import numpy as np

a = np.array([[11, 12, 13, 14, 15],
              [16, 17, 18, 19, 20],
              [21, 22, 23, 24, 25],
              [26, 27, 28, 29, 30],
              [31, 32, 33, 34, 35]])
print(a[0, 1:4])
print(a[1:4, 0])
print(a[::2, ::2])
print(a[::3, ::3])
print(a[:, 1])
# [12 13 14]
# [16 21 26]
# [[11 13 15]
#  [21 23 25]
#  [31 33 35]]
# [[11 14]
#  [26 29]]
# [12 17 22 27 32]


a = np.arange(25)
b = a.reshape(5, 5)
print(a)
print(b)
# [ 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#  24]
# [[ 0  1  2  3  4]
#  [ 5  6  7  8  9]
#  [10 11 12 13 14]
#  [15 16 17 18 19]
#  [20 21 22 23 24]]
print(b[1, :] > b[2, :])
# [False False False False False]
print(a.sum())
print(a.min())
print(a.max())
print(a.cumsum())
# 300
# 0
# 24
# [  0   1   3   6  10  15  21  28  36  45  55  66  78  91 105 120 136 153
#  171 190 210 231 253 276 300]
a = np.arange(0, 100, 10)
indices = [1, 5, -1]
b = a[indices]
print(a)
print(b)
# [ 0 10 20 30 40 50 60 70 80 90]
# [10 50 90]
